package com.berte.Demo05Runnable;

/*
*   Runnable比Thread的好处
*       1. 避免了单继承的局限性
*       2. 增强了程序的扩展性（解耦）
*           把设置线程任务和开启新线程进行了分离
* */

public class DemoRunnable {
    public static void main(String[] args) {
        MyThread mt = new MyThread();

        Thread t = new Thread(mt);

        t.start();

        for (int i = 0; i < 20; i++) {
            System.out.println("main" + i);
        }
    }
}
